#include <stdio.h>

//1.形参中的数组不是数组,他是普通指针变量
//2.形参数组:int a[100000],int a[],int *a 对编译器而言,没有任何区别.
//3.编译器都是当做int *处理
//4.形参中的数组和非形参数组区别:形参中的数组是指针变量,非形参数组就是数组.
 void print_array(int p[],int n){
 	int i = 0;
 	
 	for (int i = 0; i < n; ++i)
 	{
 		printf("%d,",p[i] );
 	}
 }



void sort_array(int p[]){

}

int main(int argc, char const *argv[])
{
	int a[10] = {8,1,2,6,-5,-9,-10,5,5,7};
	int n=sizeof(a)/sizeof(*a);
	print_array(a,n);//应该把元素个数传递过去
	return 0;
}




int main0(int argc, char const *argv[])
{
	int a[10] = {8,1,2,6,-5,-9,-10,5,5,7};
	int i = 0;
	int n = sizeof(a)/sizeof(*a);
	printf("排序前\n");
	for (i = 0; i < n; i++)
	{
		printf("%d", a[i]);
	}
	printf("\n");
	//冒泡排序
	
	int tmp;
	int j = 0;
	for (i = 0; i < n-1; i++)
	{
		for (j = 0; j < n-1-i; j++)
		{
			if (a[j] > a[j+1])
			{
				tmp = a[j];
				a[j] = a[j+1];
				a[j+1] = tmp;
			}
		}
	}
	printf("排序后 \n");
	for (i = 0; i < n; i++)
	{
		printf("%d", a[i]);
	}
	printf("\n");
	return 0;
}